package com.tanqing.ddd.domain.command;


import com.tanqing.ddd.domain.aggregate.Parkting;
import com.tanqing.ddd.domain.repository.ParktingRepository;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Component;

import java.math.BigDecimal;

@Component
public class FeeCommandHandle {

    @Resource
    private ParktingRepository parktingRepository;
    public BigDecimal handle(FeeCommand feeCommand){


        Parkting parkting = parktingRepository.fundByPlate(feeCommand.getPlate());


        return parkting.calculateFeeNow(feeCommand.getDate());

    }
}
